{capture name="hidden"}	
	<input name="admin" type="hidden" value="1">
	<input name="module" type="hidden" value="docum">
	<input name="mod" type="hidden" value="product">
	<input name="act" type="hidden" value="add_group">
	<input name="parent" type="hidden" value="{$smarty.get.form}">
	<input type="hidden" name="group_parent" value="{$smarty.get.group}" />
{/capture}
{capture name="fields"}
<!-- * -->
{ext->class_function class="docum" func="get_all_product_groups" assign="groups_list"}
{ext->class_function class="docum" func="get_permisions_container" parent=$smarty.get.form group=$smarty.get.group assign="permis_list"}
{ext->aasort array=$groups_list args="+name" assign="groups_list2"}
{assign var="groups_list" value=$groups_list2}
		<table width="100%" cellpadding="3" cellspacing="0">
			<tr>
				<td width="80" height="1"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				<td><img src="client/img/spacer.gif" class="spacer" alt="" /></td>					
			</tr>
			<tr>
				<td>{t t='Grupė'}:</td>
				<td>
					<select name="group" style="border:1px solid #A8B3B8; width:100%;"  onChange="doTheFiltering(this,'group')">
						<option value="0" {if !$smarty.get.group}selected{/if}>{t t='Nepasirinkta'}</option>
						{foreach from=$groups_list item="el"}
						{if $el.parent == 0}	
						<option value="{$el.id}"{if $smarty.get.group==$el.id} selected{/if}>{$el.name}</option>
						{/if}
						{/foreach}		
					</select>				
				</td>
			</tr>			
		</table>	
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="20"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
	</tr>
	<tr>
		<td>
{if $smarty.get.group || $smarty.get.fresh_select && $smarty.get.group > 0}
	{foreach from=$groups_list item="el2" key="key2"}
		{if $el2.parent == $smarty.get.group}		
		{capture name="keys"}{$el2.id}{/capture}{assign var="k" value=$smarty.capture.keys}
		<!-- * -->
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
		</table>
		<table cellpadding="0" cellspacing="0"  >
			<tr>		
				<td width="1" height="25"><input type="checkbox" name="group[{$el2.id}]"{if $permis_list.$k == "on"} checked{/if}/></td>
				<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				<td>{$el2.name}</td>			
			</tr>
		</table>
		<table width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			</tr>
		</table>
		<!-- /* -->
		{/if}
	{/foreach}
{else}
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
	<tr>
		<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
		<td height="30" bgcolor="#FFFFFF">{if $smarty.get.fresh_select}{t t='Pasirinkite grupę'}{else}<a href="#" onClick="top.opener.window.document.forms['form{$smarty.get.form}']['{$smarty.get.name}'].value=''; window.opener.document.forms['form{$smarty.get.form}']['{$smarty.get.name}_just_display'].value=''; window.close();" target="_self">{t t='Išvalyti pasirinkimą'}</a>{/if}</td>		
	</tr>
</table>
{/if}
		</td>		
	</tr>
</table>
<!-- /* -->
{/capture}
{capture name="fields1"}
	<!-- * -->
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	<!-- /* -->
	{ext->class_function class="docum" func="get_all_product_groups" assign="groups_list"}
	{foreach from=$groups_list item="el"}
	{if $el.parent == 0}
	<!-- * -->
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="0">
		<tr>		
			<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			<td height="22" width="0"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			<td width="1"><img src="_tvs_system_core_/design/img/document_copy.gif"></td>
			<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			<td>{$el.name}</td>			
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1"   valign="top" align="center" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	<!-- /* -->
	{foreach from=$groups_list item="el2"}
		{if $el2.parent == $el.id}
			<!-- * -->
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="0">
				<tr>		
					<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					<td height="22" width="20"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					<td width="1"><img src="_tvs_system_core_/design/img/document_copy.gif"></td>
					<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					<td><a href="#" onClick="window.opener.document.forms['form{$smarty.get.form}']['{$smarty.get.name}'].value='{$el2.id}'; window.opener.document.forms['form{$smarty.get.form}']['{$smarty.get.name}_just_display'].value='{$el2.name}';" class="blackUnderline">{$el2.name}</a></td>			
				</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				</tr>
			</table>
			<!-- /* -->
		{/if}
	{/foreach}
	{/if}
{/foreach}
{/capture}